class MeshVisualization : public QWidget {
public:
    MeshVisualization(QWidget* parent = nullptr) : QWidget(parent) {
        // 创建VTK渲染器
        m_renderer = vtkSmartPointer<vtkRenderer>::New();
        m_renderWindow = vtkSmartPointer<vtkRenderWindow>::New();
        m_renderWindow->AddRenderer(m_renderer);
        
        // 创建交互器
        m_interactor = vtkSmartPointer<vtkRenderWindowInteractor>::New();
        m_interactor->SetRenderWindow(m_renderWindow);
        
        // 设置布局
        auto layout = new QVBoxLayout(this);
        m_vtkWidget = new QVTKWidget;
        m_vtkWidget->SetRenderWindow(m_renderWindow);
        layout->addWidget(m_vtkWidget);
        
        // 添加控制面板
        addControlPanel(layout);
    }

    // 更新网格显示
    void updateMeshDisplay(const MeshData& mesh, const std::vector<double>& quality) {
        // 创建VTK数据结构
        auto points = vtkSmartPointer<vtkPoints>::New();
        auto cells = vtkSmartPointer<vtkCellArray>::New();
        auto qualityArray = vtkSmartPointer<vtkDoubleArray>::New();
        
        // 转换数据
        convertToVTKStructures(mesh, points, cells, quality, qualityArray);
        
        // 更新显示
        updateRenderer(points, cells, qualityArray);
    }

private:
    vtkSmartPointer<vtkRenderer> m_renderer;
    vtkSmartPointer<vtkRenderWindow> m_renderWindow;
    vtkSmartPointer<vtkRenderWindowInteractor> m_interactor;
    QVTKWidget* m_vtkWidget;
}; 